<template>
  <div class="">
    <div class=""> 
      
    </div>
    <loader :loadShow="loadShow" />
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { sessionApi, imgCodeApi, loginApi } from '@/commons/api'
import routes from '@/commons/router'
import Msg from '@/components/message'
import Loader from '@/components/loader/Loader.vue'
import Msg from '@/components/message'

// 挂载前判断用户是否登录，如果已登录，则直接跳转到主页
onMounted(() => {
  // hasLogin()
})

// 定义是否显示加载中的变量
let loadShow = ref(false)

// hasLogin 判断用户是否已经登录，如果已登录，则直接跳转到主页
const hasLogin = async () => {
  loadShow.value = true
  const res = await sessionApi()
  if(res.code === 200) {
    
  } else {
    localStorage.removeItem('token')
    Msg({ kind: 'error', txt: res.msg })
    routes.replace({path: '/'})
  }
  loadShow.value = false
}
</script>

<style scoped>

</style>